package com.cn.xiaonuo.tcrfinance.tcrnews.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.common.vo.CommonParam;
import com.cn.xiaonuo.tcrfinance.tcrnews.entity.PvArticle;
import com.cn.xiaonuo.tcrfinance.tcrnews.service.HpcArticlesSerive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@CrossOrigin
@RestController
public class HpcArticlesController {

    @Autowired
    HpcArticlesSerive hpcArticlesSerive;

    @PostMapping(value = "/api/articles/selectArticles")
    public BusinessMessage selectArticles(@RequestBody CommonParam commonParam) {
        return hpcArticlesSerive.selectArticles(commonParam);
    }

    @PostMapping(value = "/api/articles/updateArticle")
    public BusinessMessage updateArticle(@RequestBody PvArticle pvArticle) {
        return hpcArticlesSerive.updateArticle(pvArticle);
    }

    @PostMapping(value = "/api/articles/deleteArticle")
    public BusinessMessage deleteArticle(@RequestBody PvArticle pvArticle) {
        return hpcArticlesSerive.deleteArticle(pvArticle);
    }

    @PostMapping(value = "/api/articles/insertArticle")
    public BusinessMessage insertArticle(@RequestBody PvArticle pvArticle) {
        return hpcArticlesSerive.insertArticle(pvArticle);
    }

    @PostMapping(value = "/api/articles/selectAllRegisterinfos")
    public BusinessMessage selectAllRegisterinfos(@RequestBody Map<String, Object> params) {
        return hpcArticlesSerive.selectAllRegisterinfos(params);
    }


}
